#ifndef SESNORINFO_H
#define SESNORINFO_H

#include <QObject>
#include <QTimer>

class SensorInfo : public QObject {
    Q_OBJECT
public:
    static SensorInfo &getInstance(){
        static SensorInfo m_info;
        return m_info;
    }
    uint8_t getSensorType() const;
    bool getIsOpenRegisterOperationPage() const;
    void setIsOpenRegisterOperationPage(bool value);

private:
    QTimer m_waitResponseTimer;
    QTimer m_querySensorTimer;
    QTimer m_queryImageErrorTimer;
    explicit SensorInfo(QObject *parent = nullptr);
    void onQuerySensor();
    void onHaveSensorSwitch(uint8_t value);
    uint8_t m_sensorType;
    int m_waitCount;
    bool m_isOpenRegisterOperationPage = false;
    uint32_t m_mcuSensorState = false;
    uint32_t m_fpgaSensorState = false;
signals:
    void sensorTypeChanged();
};

#endif // SESNORINFO_H
